home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / mxcode / soundx / fmtest.c < prev    next >
C/C++ Source or Header  |  1993-06-27  |  1KB  |  64 lines

  1. #include <stddef.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <dos.h>
  5. #include <io.h>
  6. #include <fcntl.h>
  7. #include <alloc.h>
  8. #include <sys\stat.h>
  9. #include "mydef.h"
  10. #include "sound.h"
  11. #include "dmalib.h"
  12. #include "timerx.h"
  13.  
  14. char      inst[4][11] =
  15.     {
  16.         {   0x021,0x011,0x04C,0x000,0x0F1,0x0F2,0x063,0x072,
  17.             0x000,0x000,0x004},
  18.  
  19.         {   0x0A5,0x0B1,0x0D2,0x080,0x081,0x0F1,0x003,0x005,
  20.             0x000,0x000,0x002},
  21.  
  22.         {   0x072,0x062,0x01C,0x005,0x051,0x052,0x003,0x013,
  23.             0x000,0x000,0x00E},
  24.  
  25.         {   0x011,0x001,0x08A,0x040,0x0F1,0x0F1,0x011,0x0B3,
  26.             0x000,0x000,0x006}                                };
  27.  
  28.  
  29. void PlayTest ()
  30. {
  31.     unsigned int i,j;
  32.     int note,instn,voice;
  33.  
  34.  
  35.  
  36.     static BYTE note_num[] = {60,62,64,65,67,69,71,72,74};
  37.  
  38.  
  39.     for(voice=0;voice<1;voice++)
  40.     {
  41.         for ( instn= 0; instn < 4; instn++ )
  42.         {
  43.             FM_SetVoice ( 0,inst[instn]) ;
  44.             FM_SetVol(voice,0x60);
  45.  
  46.             for ( note=0; note < 9; note++ )
  47.             {
  48.                 FM_SetNote ( voice, note_num[note]) ;
  49.                 FM_KeyOn(voice);
  50.                 msdelay(400);
  51.                 FM_KeyOff(voice);
  52.             }
  53.         }
  54.     }
  55. }
  56.  
  57. void main()
  58. {
  59.     SB_Setup();
  60.  
  61.     PlayTest();
  62. }
  63.  
  64.